home *** CD-ROM | disk | FTP | other *** search
- Elric 31
- New F1 User Editor.
-
-
- This procedure is just dropped into place on top of the current version of
- val_cur_user() in conio.c. It adds several fields to the editor...the fields
- now include name, real name, password, phone number, note, SL, DSL, AR, DAR,
- Exemptions (in a bit mapped format), sysop sub, # of posts and calls,
- # and total size of both uploads and downloads. Also, the current post to
- call ratio is displayed.
-
- Another neat feature is that you can now edit anyone you choose.
- Use the up and down arrows to move around. If you place the cursor on
- top of the user number, then use the left and right arrows to scroll through
- the user list. Or, hit enter, and it will prompt you for a user number.
-
-
- Have fun.
- ---------------------------------------------------------------
- Good Lord, I made this back in 1989 or 1990, but as far
- as I remember I NEVER released it. In fact, I didn't even install it
- the past few versions. But here it is, dusted off and updated
- for 4.20/4.21. If you are using something earlier, good luck.
-
- Acutally, it won't be that much different, down at the bottom replace
- the line that says
-
- reset_act_sl();
-
- with this line
-
- realsl=thisuser.sl;
-
- However, I'm not real sure about that, maybe it's supposed to be
-
- actsl=thisuser.sl;
-
- Could be both of them. <GRIN> Anyway, here's the mod.
-
-
- -----------------------------------------------------------------
- BUG FIX!! I released a version of this yesterday without the
- strip_space procedure. If that is not installed, anyone who gets
- edited will not be able to log on again, because it will add spaces
- to the end of their password. Just install this version, compile,
- run the BBS. Then just use the right arrow to scroll through the user
- list, and it will strip the spaces off all the passwords again.
-
- Sorry for any inconvenience.
- -------------------------------------------------------------
-
- /** this step is indeed a form step, much like a form letter **/
- 1. From DOS, in your dir where you keep your source....
-
- PKZIP SOURCE *.c *.h
-
- If you already have a source zip file, then
-
- PKZIP -f source *.c *.h
-
- This way you have a copy of everything before you screw it up with a bad mod.
- If you decide to take the mod out, it's as easy as
- PKUNZIP -x source
-
- and hit Y to overwrite any files you changed.
-
- /** we now resume our regularly scheduled mod with step 2.... **/
-
-
- 2. Load up conio.c. Delete the current copy of val_cur_user(), and replace it
- with this one. Also, make sure you add the procedure strip_space right
- in front of val_cur_user().
-
-
- void strip_space(char *ss)
- {
- int i;
-
- while (ss[strlen(ss)-1]==32)
- ss[strlen(ss)-1]=0;
- }
-
- void val_cur_user()
- /* val_cur_user allows the sysop at the keyboard to validate the current user,
- chaning sl, dsl, ar, dar, sysop sub, exemptions, restrictions, and user
- note
-
- Extreme modification by Lord Elric. This makes this officially Elric31.
-
- Now allows editing of name, real name, phone number, password, note,
- number of calls, number of posts, number and size of uploads/downloads
-
- Use the up and down arrows to move between fields. Place the cursor on
- the user number, and either use the left and right arrows to roll the users
- around, or hit enter and enter a user number. Either way, it allows
- you to edit anyone, no matter who is on line. Always drops back to the
- current user upon exit. It's as debugged as it's gonna get.
-
- One last note, the Exemptions are now displayed and edited in a bitmapped
- format. The only one that has any effect at all is bit 0, but you can code
- others in if you want to. I did.
-
- */
- {
-
- char sl[4],dsl[4],exempt[17],sysopsub[4],ar[17],dar[17],restrict[17],rst[17],
- tl[50],dk[34],uk[34],ndl[33],nul[33],pr[5],cr[5],usern[6],gold[11];
- int cp,i,done,rc,wx,wy;
- double ratio;
- unsigned int unum,oldn;
- userrec un;
- int ch,ch2;
-
- #define MAXEDITBOXES 18
-
- pr_wait(1);
- savescreen(&screensave);
- curatr=14;
- wx=15;
- wy=4;
- unum=usernum; /** unum points to the current "editee" **/
- oldn=0; /** oldnum points to previous unum, nuke it for now **/
- write_user(usernum,&thisuser); /** write the old record out **/
- read_user(unum,&un); /** read it back in, in un **/
- done=0;
- cp=0;
-
- makewindow(wx,wy,50,17); /** make the box on the screen */
-
- while (done==0) {
- if (oldn!=unum) {
- itoa((int)un.sl,sl,10);
- itoa((int)unum,usern,10);
- itoa((int)un.dsl,dsl,10);
- itoa((int)un.sysopsub,sysopsub,10);
- ultoa(un.dk,dk,10);
- ultoa(un.uk,uk,10);
- itoa((int)un.downloaded,ndl,10);
- itoa((int)un.uploaded,nul,10);
- itoa((int)un.msgpost,pr,10);
- itoa((int)un.logons,cr,10);
- ltoa((long)un.gold,gold,10);
- strcpy(rst,restrict_string);
- for (i=0; i<=15; i++) {
- if (un.ar & (1 << i))
- ar[i]='A'+i;
- else
- ar[i]=32;
- if (un.dar & (1 << i))
- dar[i]='A'+i;
- else
- dar[i]=32;
- if (un.restrict & (1 << i))
- restrict[i]=rst[i];
- else
- restrict[i]=32;
- }
- for (i=0; i<=7; i++) {
- if (un.exempt & (1<<i))
- exempt[7-i]='0'+i;
- else
- exempt[7-i]=32;
- }
- exempt[8]=0;
- dar[16]=0;
- ar[16]=0;
- restrict[16]=0;
-
-
- movecsr(wx+2,wy+1); sprintf(tl,"NAME %-30s",un.name); outs(tl);
- movecsr(wx+39,wy+1); sprintf(tl,"USER# %-4s",usern); outs(tl);
- movecsr(wx+2,wy+2); sprintf(tl,"RN %-20s",un.realname); outs(tl);
- movecsr(wx+2,wy+3); sprintf(tl,"PHONE %-12s",un.phone); outs(tl);
- movecsr(wx+22,wy+3); sprintf(tl,"PW %-8s",un.pw); outs(tl);
- movecsr(wx+2,wy+5); sprintf(tl,"NOTE %-40s",un.note); outs(tl);
- movecsr(wx+2,wy+7); sprintf(tl,"SL %-3s",sl); outs(tl);
- movecsr(wx+13,wy+7); sprintf(tl,"AR %-s",ar); outs(tl);
- movecsr(wx+34,wy+7); sprintf(tl,"EXMPT %-s",exempt); outs(tl);
- movecsr(wx+2,wy+8); sprintf(tl,"DSL %-3s",dsl); outs(tl);
- movecsr(wx+13,wy+8); sprintf(tl,"DAR %-s",dar); outs(tl);
- movecsr(wx+34,wy+8); sprintf(tl,"SYSOP SUB %-3s",sysopsub); outs(tl);
- movecsr(wx+8,wy+9); sprintf(tl,"RESTRICT %-s",restrict); outs(tl);
- movecsr(wx+2,wy+11); sprintf(tl,"#UL %-4s",nul); outs(tl);
- movecsr(wx+13,wy+11); sprintf(tl,"UL KB %-9s",uk); outs(tl);
- movecsr(wx+2,wy+12); sprintf(tl,"#DL %-4s",ndl); outs(tl);
- movecsr(wx+13,wy+12); sprintf(tl,"DL KB %-9s",dk); outs(tl);
- movecsr(wx+2,wy+13); sprintf(tl,"#POSTS %-4s",pr); outs(tl);
- movecsr(wx+15,wy+13); sprintf(tl,"#CALLS %-4s",cr); outs(tl);
- movecsr(wx+2,wy+14); sprintf(tl,"GOLD %-6s",gold); outs(tl);
- oldn=unum;
- }
-
- ratio=0;
- if (un.logons>0)
- ratio=(float) un.msgpost / (float) un.logons;
- if (ratio>99.99)
- ratio=99.99;
- movecsr(wx+28,wy+13); sprintf(tl,"P/C %-6.3lf",ratio); outs(tl);
- switch(cp) {
- case 0:
- movecsr(wx+45,wy+1);
- ch=getch();
- switch (ch) {
- case 0:
- ch2=getch();
- rc=0;
- switch (ch2){
- case 75:
- unum-=1;
- if (unum==0)
- unum=status.users;
- break;
- case 77:
- unum+=1;
- if (unum>status.users)
- unum=1;
- break;
- case 72:
- rc=PREV;
- break;
- case 80:
- rc=NEXT;
- break;
- case 59:
- rc=DONE;
- break;
- }
- break;
- case 13:
- editline(usern,4,NUM_ONLY,&rc,"");
- unum=atoi(usern);
- if (unum>status.users)
- unum=status.users;
- itoa((int)unum,usern,10);
- sprintf(tl,"%-4s",usern); outs(tl);
-
- rc=0;
- break;
- }
- if (unum!=oldn){
- strip_space(un.pw);
- strip_space(un.note);
- write_user(oldn,&un);
- read_user(unum,&un);
- }
- break;
- case 1:
- movecsr(wx+7,wy+2);
- editline(un.realname,20,ALL,&rc,"");
- break;
- case 2:
- movecsr(wx+8,wy+3);
- editline(un.phone,12,ALL,&rc,"");
- break;
- case 3:
- movecsr(wx+25,wy+3);
- editline(un.pw,8,ALL,&rc,"");
- break;
- case 4:
- movecsr(wx+7,wy+5);
- editline(un.note,40,ALL,&rc,"");
- break;
- case 5:
- movecsr(wx+7,wy+7);
- editline(sl,3,NUM_ONLY,&rc,"");
- un.sl=(char) atoi(sl);
- itoa((int)un.sl,sl,10);
- sprintf(tl,"%-3s",sl); outs(tl);
- break;
- case 6:
- movecsr(wx+17,wy+7);
- editline(ar,16,SET,&rc,"ABCDEFGHIJKLMNOP");
- un.ar=0;
- for (i=0; i<=15; i++)
- if (ar[i]!=32)
- un.ar |= (1 << i);
- break;
- case 7:
- movecsr(wx+40,wy+7);
- editline(exempt,8,SET,&rc,"76543210");
- un.exempt=0;
- for (i=0; i<=7; i++)
- if (exempt[i]!=32)
- un.exempt |= (0xF0 >> i);
- break;
- case 8:
- movecsr(wx+7,wy+8);
- editline(dsl,3,NUM_ONLY,&rc,"");
- un.dsl=(char) atoi(dsl);
- itoa((int)un.dsl,dsl,10);
- sprintf(tl,"%-3s",dsl); outs(tl);
- break;
- case 9:
- movecsr(wx+17,wy+8);
- editline(dar,16,SET,&rc,"ABCDEFGHIJKLMNOP");
- un.dar=0;
- for (i=0; i<=15; i++)
- if (dar[i]!=32)
- un.dar |= (1 << i);
- break;
- case 10:
- movecsr(wx+44,wy+8);
- editline(sysopsub,3,NUM_ONLY,&rc,"");
- un.sysopsub=(char) atoi(sysopsub);
- itoa((int)un.sysopsub,sysopsub,10);
- sprintf(tl,"%-3s",sysopsub); outs(tl);
- break;
- case 11:
- movecsr(wx+17,wy+9);
- editline(restrict,16,SET,&rc,rst);
- un.restrict=0;
- for (i=0; i<=15; i++)
- if (restrict[i]!=32)
- un.restrict |= (1 << i);
- break;
- case 12:
- movecsr(wx+6,wy+11);
- editline(nul,4,NUM_ONLY,&rc,"");
- un.uploaded=(int) atoi(nul);
- itoa((int)un.uploaded,nul,10);
- sprintf(tl,"%-4s",nul); outs(tl);
- break;
- case 13:
- movecsr(wx+19,wy+11);
- editline(uk,9,NUM_ONLY,&rc,"");
- un.uk= atol(uk);
- ultoa(un.uk,uk,10);
- sprintf(tl,"%-9s",uk); outs(tl);
- break;
- case 14:
- movecsr(wx+6,wy+12);
- editline(ndl,4,NUM_ONLY,&rc,"");
- un.downloaded=(int) atoi(ndl);
- itoa((int)un.downloaded,ndl,10);
- sprintf(tl,"%-4s",ndl); outs(tl);
- break;
- case 15:
- movecsr(wx+19,wy+12);
- editline(dk,9,NUM_ONLY,&rc,"");
- un.dk= atol(dk);
- itoa(un.dk,dk,10);
- sprintf(tl,"%-9s",dk); outs(tl);
- break;
- case 16:
- movecsr(wx+9,wy+13);
- editline(pr,4,NUM_ONLY,&rc,"");
- un.msgpost=(int) atoi(pr);
- itoa(un.msgpost,pr,10);
- sprintf(tl,"%-4s",pr); outs(tl);
- break;
- case 17:
- movecsr(wx+22,wy+13);
- editline(cr,4,NUM_ONLY,&rc,"");
- un.logons=(int) atoi(cr);
- itoa(un.logons,cr,10);
- sprintf(tl,"%-4s",cr); outs(tl);
- break;
- case 18:
- movecsr(wx+7,wy+14);
- editline(gold,6,NUM_ONLY,&rc,"");
- un.gold=(float) atoi(gold);
- itoa(un.gold,gold,10);
- sprintf(tl,"%-6s",gold); outs(tl);
- break;
- }
- switch(rc) {
- case DONE: done=1; break;
- case NEXT: cp=(cp+1) % (MAXEDITBOXES +1); break;
- case PREV: cp=(cp+MAXEDITBOXES) % (MAXEDITBOXES +1); break;
- }
- }
- restorescreen(&screensave);
- strip_space(un.pw); /** added for new version **/
- strip_space(un.note); /** added for new version **/
- write_user(unum,&un); /** write out whoever it was we were
- editing. **/
- read_user(usernum,&thisuser); /** read in the guy online **/
- close_user(); /** close the user file **/
- reset_act_sl();
- changedsl();
- pr_wait(0);
- }
-
-
- /** hey, it's the form info file **/
- As usual, I take no responsibility for hard drive crashes, death in the
- family, or end of the world as we know it resulting from this mod.
- It's your fault if you didn't back up the files before you made the mod.
- It's your fault if you don't back up your ENTIRE hard drive AT LEAST once
- a month.
- It works on my system with Turbo C++, WWIV 4.2.
-
- Lord Elric
- 1@18270
- 4@18251
-
-